package com.pzb.web.controller.wechat;

import com.pzb.rabbitmq.RabbitMqModel;
import com.pzb.rabbitmq.RabbitMqSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private RabbitMqSender rabbitMqSender;

    @GetMapping("/send")
    public void sendMessage(@RequestParam("orderNo") String orderNo){
        RabbitMqModel mqModel = new RabbitMqModel();
        mqModel.setType(0);
        mqModel.setOrderNo(orderNo);
        rabbitMqSender.sendMessage(mqModel,30*1000);
    }
}
